package org.forever.view 
{
	import flash.display.DisplayObject;
	import flash.display.MorphShape;
	import flash.events.MouseEvent;
	import flash.ui.Mouse;
	
	import mx.controls.Alert;
	import mx.controls.Image;
	import mx.core.IUIComponent;
	import mx.core.IVisualElement;
	import mx.core.UIComponent;
	import mx.graphics.SolidColorStroke;
	import mx.logging.ILogger;
	import mx.logging.Log;
	import mx.managers.CursorManager;
	 
	import spark.components.BorderContainer; 
	import spark.components.SkinnableContainer;
	import spark.components.mediaClasses.VolumeBar;
	import spark.primitives.Line;

	/**
	 *调整UI组件的一个类，放大，缩小，移动
	 */
	public class ResizeUI{
		private var _resizeContainer:ResizeContainer;
		private static var _log:ILogger = Log.getLogger("org.forever.view.ResizeUI");
		/**待调整的组件对象*/
		private var _uiComp:IUIComponent;
		/**显示所有可变组件的容器*/
		private var _container:SkinnableContainer;
		
		/**该可变组件的外围组件构成,八个小矩形，八根线条，一个大矩形*/	
		/**中间矩形*/
		private var _centerRect:BorderContainer;
		/**左上矩形*/
		private var _leftTopRect:BorderContainer;
		/**右上矩形*/
		private var _rightTopRect:BorderContainer;
		/**左下矩形*/
		private var _leftBottomRect:BorderContainer;
		/**右下矩形*/
		private var _rightBottomRect:BorderContainer;
		/**上中矩形*/
		private var _topCenterRect:BorderContainer;
		/**左中矩形*/
		private var _leftCenterRect:BorderContainer;
		/**下中矩形*/
		private var _bottomCenterRect:BorderContainer;
		/**右中矩形*/
		private var _rightCenterRect:BorderContainer;
		/**左上矩形和上中矩形之间的线条*/
		private var _leftTopTopCenterLine:Line;
		/**上中矩形和右上矩形之间的线条*/
		private var _topCenterRightTopLine:Line;
		/**左上矩形和左中矩形之间的线条*/
		private var _leftTopLeftCenterLine:Line;
		/**左中矩形和左下矩形之间的线条*/
		private var _leftCenterLeftBottomLine:Line;
		/**左下矩形和下中矩形之间的线条*/
		private var _leftBottomBottomCenterLine:Line;
		/**下中矩形和右下矩形之间的线条*/
		private var _bottomCenterRightBottomLine:Line;
		/**右中矩形和右下矩形之间的线条*/
		private var _rightCenterRightBottomLine:Line;
		/**右上矩形和右中矩形之间的线条*/
		private var _rightTopRightCenterLine:Line;
		
		private var _rect_w:Number = 6; 
		/**是否开始移动，默认false*/
		private var _startMove:Boolean = false;
		/**是否正在移动中，默认false*/
		private var _moving:Boolean = false;
		
		/**初始化方法*/
		public function ResizeUI(uiComp:IUIComponent,container:SkinnableContainer){
			_uiComp = uiComp;
			_container = container;
			
			initCenterRect();
			initAllRectProp();
			updateCenterRect();
			initAllLine();
			
			_uiComp.addEventListener(MouseEvent.MOUSE_DOWN,uiCompMouseDownHandler);
			_uiComp.addEventListener(MouseEvent.MOUSE_MOVE,uiCompMouseMoveHandler);
			_uiComp.addEventListener(MouseEvent.MOUSE_UP,uiCompMouseUpHandler);
			
			_centerRect.addEventListener(MouseEvent.MOUSE_UP,centerRectMouseUpHandler);
			_centerRect.addEventListener(MouseEvent.MOUSE_MOVE,centerRectMouseMoveHandler);
			
			_rightCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,rightCenterMouseDownHandler);
			_topCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,topCenterRectMouseDownHandler);
			_bottomCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,bottomCenterRectMouseDownHandler);
			_leftCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,leftCenterRectMouseDownHandler);
			
			_rightTopRect.addEventListener(MouseEvent.MOUSE_DOWN,rightTopRectMouseDownHandler);
			_rightBottomRect.addEventListener(MouseEvent.MOUSE_DOWN,rightBottomRectMouseDownHandler);
			_leftTopRect.addEventListener(MouseEvent.MOUSE_DOWN,leftTopRectMouseDownHandler);
			_leftBottomRect.addEventListener(MouseEvent.MOUSE_DOWN,leftBottomRectMouseDownHandler);
			
		}
		
		/**************************get and set************************/
		public function get resizeContainer():ResizeContainer
		{
			return _resizeContainer;
		}

		public function set resizeContainer(value:ResizeContainer):void
		{
			_resizeContainer = value;
		}

		/**初始化中间矩形*/
		public function initCenterRect():void{
			_centerRect = new BorderContainer();
			_centerRect.setStyle("borderColor","c9ddcb");
			_centerRect.alpha = 0.3;
			_centerRect.visible = false;
			_container.addElement(_centerRect);
		}
		
		/**初始化所有矩形*/
		public function initAllRectProp():void{
			_leftTopRect = new BorderContainer();
			_rightTopRect = new BorderContainer();
			_leftBottomRect = new BorderContainer();
			_rightBottomRect = new BorderContainer();
			_topCenterRect = new BorderContainer();
			_leftCenterRect = new BorderContainer();
			_bottomCenterRect = new BorderContainer();
			_rightCenterRect = new BorderContainer();
			
			initRectProp(_leftTopRect);
			initRectProp(_rightTopRect);
			initRectProp(_leftBottomRect);
			initRectProp(_rightBottomRect);
			initRectProp(_topCenterRect);
			initRectProp(_leftCenterRect);
			initRectProp(_bottomCenterRect);
			initRectProp(_rightCenterRect);
		}
		
		/**初始化所有线条*/
		public function initAllLine():void{
			_leftTopTopCenterLine = new Line();
			_leftTopTopCenterLine.stroke = new SolidColorStroke(0x70b2ee);
			_topCenterRightTopLine = new Line();
			_topCenterRightTopLine.stroke = new SolidColorStroke(0x70b2ee);
			_leftTopLeftCenterLine = new Line();
			_leftTopLeftCenterLine.stroke = new SolidColorStroke(0x70b2ee);
			_leftCenterLeftBottomLine = new Line();
			_leftCenterLeftBottomLine.stroke = new SolidColorStroke(0x70b2ee);
			_leftBottomBottomCenterLine = new Line();
			_leftBottomBottomCenterLine.stroke = new SolidColorStroke(0x70b2ee);
			_bottomCenterRightBottomLine = new Line();
			_bottomCenterRightBottomLine.stroke = new SolidColorStroke(0x70b2ee);
			_rightCenterRightBottomLine = new Line();
			_rightCenterRightBottomLine.stroke = new SolidColorStroke(0x70b2ee);
			_rightTopRightCenterLine = new Line();
			_rightTopRightCenterLine.stroke =  new SolidColorStroke(0x70b2ee);
			_container.addElement(_leftTopTopCenterLine);
			_container.addElement(_topCenterRightTopLine);
			_container.addElement(_leftTopLeftCenterLine);
			_container.addElement(_leftCenterLeftBottomLine);
			_container.addElement(_leftBottomBottomCenterLine);
			_container.addElement(_bottomCenterRightBottomLine);
			_container.addElement(_rightCenterRightBottomLine);
			_container.addElement(_rightTopRightCenterLine);	
		}
		
		public function uiCompMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.current_resizeUI = this;
			_startMove = true;//点击组件做移动准备
			_moving = false;//并未真正移动 
			_log.debug("_centerRect准备开始移动......");
			updateCenterRect();
			showResizeUI();
		}
		
		/**更新组件的状态*/
		public function updateUIComp():void{
			_uiComp.x = _leftTopRect.x + _leftTopRect.width;
			_uiComp.y = _leftTopRect.y + _leftTopRect.height;
			_uiComp.width = _rightTopRect.x - _leftTopRect.x - _leftTopRect.width;
			_uiComp.height = _leftBottomRect.y - _leftTopRect.y - _leftTopRect.height;
			_log.debug("updateUIComp.........");
			updateCenterRect();
		}
		
		/**更新中间矩形状态*/
		public function updateCenterRect():void{
			_centerRect.x = _uiComp.x;
			_centerRect.y = _uiComp.y;
			_centerRect.width = _uiComp.width;
			_centerRect.height = _uiComp.height;
			_log.debug("updateCenterRect....."); 
			
		}
		
		
		public function uiCompMouseMoveHandler(event:MouseEvent):void{
			if(_startMove && !_moving){
				_uiComp.visible = false;
				_centerRect.visible = true;
				_centerRect.startDrag();
				_moving = true;
				_log.debug("_centerRect开始移动......");
			}
		}	
		
		public function centerRectMouseMoveHandler(event:MouseEvent):void{
			refreshResizeUI();
		}
		
		public function centerRectMouseUpHandler(event:MouseEvent):void{
			stopCenterRectMove();
			refreshResizeUI();
		}
		
		/**停止中间矩形的移动*/
		public function stopCenterRectMove():void{
			_startMove = false;
			_moving = false;
			_centerRect.stopDrag();
			_uiComp.x = _centerRect.x;
			_uiComp.y = _centerRect.y;
			_uiComp.visible = true;
			_centerRect.visible = false;
			_log.debug("停止_centerRect的移动........");
			
		}
		
		public function uiCompMouseUpHandler(event:MouseEvent):void{
			stopCenterRectMove();
		}
		
		public function rightCenterMouseOverHandler(event:MouseEvent):void{
			Mouse.hide();
		}
		
		public function rightCenterMouseOutHandler(event:MouseEvent):void{
			Mouse.show();
		}
		
		public function leftBottomRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateLeftBottomRectCall;
		}
		
		public function updateLeftBottomRectCall(event:MouseEvent):void{
			updateLeftCenterRectCall(event);
			updateBottomCenterRectCall(event);
		}
		
		public function leftTopRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateLeftTopRectCall;
		}
		
		public function updateLeftTopRectCall(event:MouseEvent):void{
			updateTopCenterRectCall(event);
			updateLeftCenterRectCall(event);
			
		}
		
		public function rightBottomRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateRightBottomRectCall;
		}
		
		public function updateRightBottomRectCall(event:MouseEvent):void{
			updateRightCenterRectCall(event);
			updateBottomCenterRectCall(event);
		}
		
		public function rightTopRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateRightTopRectCall;
		}
		
		public function updateRightTopRectCall(event:MouseEvent):void{
			updateRightCenterRectCall(event);
			updateTopCenterRectCall(event);
		}
		
		public function leftCenterRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateLeftCenterRectCall;
		}
		
		public function updateLeftCenterRectCall(event:MouseEvent):void{
			_leftCenterRect.x = _container.mouseX;
			_leftTopRect.x = _leftCenterRect.x;
			_leftBottomRect.x = _leftCenterRect.x;
			updateLeftTopLeftCenterLine();
			updateLeftCenterLeftBottomLine();
			updateLeftTopTopCenterLine();
			updateLeftBottomBottomCenterLine();
			updateTopCenterRect();
			updateBottomCenterRect();
			updateTopCenterRightTopLine();
			updateBottomCenterRightBottomLine();
		}
		
		public function bottomCenterRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateBottomCenterRectCall;
		}
		
		public function updateBottomCenterRectCall(event:MouseEvent):void{
			_bottomCenterRect.y = _container.mouseY;
			_leftBottomRect.y = _bottomCenterRect.y;
			_rightBottomRect.y = _bottomCenterRect.y;
			updateLeftBottomBottomCenterLine();
			updateBottomCenterRightBottomLine();
			updateLeftCenterLeftBottomLine();
			updateRightCenterRightBottomLine();
			updateLeftCenterRect();
			updateRightCenterRect();
			updateLeftTopLeftCenterLine();
			updateRightTopRightCenterLine();
			
		}
		
		public function topCenterRectMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateTopCenterRectCall;
		}
		
		public function updateTopCenterRectCall(event:MouseEvent):void{
			_topCenterRect.y = _container.mouseY;
			_leftTopRect.y = _topCenterRect.y;
			_rightTopRect.y = _topCenterRect.y;
			updateLeftTopTopCenterLine();
			updateTopCenterRightTopLine();
			updateLeftTopLeftCenterLine();
			updateRightTopRightCenterLine();
			updateLeftCenterRect();
			updateRightCenterRect();
			updateLeftCenterLeftBottomLine();
			updateRightCenterRightBottomLine();
		}
		
		public function rightCenterMouseDownHandler(event:MouseEvent):void{
			event.stopImmediatePropagation();
			_resizeContainer.mouseMoveCallFun = updateRightCenterRectCall;
		}
		
		public function updateRightCenterRectCall(event:MouseEvent):void{
			_rightCenterRect.x = _container.mouseX;
			_rightTopRect.x = _rightCenterRect.x;
			_rightBottomRect.x = _rightCenterRect.x;
			updateRightTopRightCenterLine();
			updateRightCenterRightBottomLine();
			updateTopCenterRightTopLine();
			updateBottomCenterRightBottomLine();
			updateTopCenterRect();
			updateBottomCenterRect();
			updateLeftBottomBottomCenterLine();
			updateLeftTopTopCenterLine();
			
		}
		
		/**更新右中矩形y坐标*/
		public function updateRightCenterRect():void{
			_rightCenterRect.y = (_rightTopRect.y + _rightBottomRect.y)/2;
		}
		/**更新左中矩形y坐标*/
		public function updateLeftCenterRect():void{
			_leftCenterRect.y = (_leftTopRect.y + _leftBottomRect.y)/2;
		}
		/**更新上中矩形x坐标*/
		public function updateTopCenterRect():void{
			_topCenterRect.x = (_leftTopTopCenterLine.xFrom + _topCenterRightTopLine.xTo)/2;
		}
		/**更新下中矩形x坐标*/
		public function updateBottomCenterRect():void{
			_bottomCenterRect.x = (_leftBottomBottomCenterLine.xFrom + _bottomCenterRightBottomLine.xTo)/2;
		}
		
		/**初始化小矩形的属性*/
		public function initRectProp(_rect:BorderContainer):void{
			_rect.width = _rect_w;
			_rect.height = _rect_w;
			_rect.visible = false;
			_rect.setStyle("borderColor","#70B2EE");
			_container.addElement(_rect);
		}
		
		/**显示8个小矩形框*/
		public function showAllRect():void{
			_leftTopRect.visible = true;
			_rightTopRect.visible = true;
			_leftBottomRect.visible = true;
			_rightBottomRect.visible = true;
			_topCenterRect.visible = true;
			_leftCenterRect.visible = true;
			_bottomCenterRect.visible = true;
			_rightCenterRect.visible = true;
		}
		
		/**隐藏外围组件*/
		public function hideResizeUI():void{
			hideAllRect();
			hideAllLine();
			
		}
		
		/**显示8条线*/
		public function showAllLine():void{
			_leftTopTopCenterLine.visible = true;
			_topCenterRightTopLine.visible = true;
			_leftTopLeftCenterLine.visible = true;
			_leftCenterLeftBottomLine.visible = true;
			_leftBottomBottomCenterLine.visible = true;
			_bottomCenterRightBottomLine.visible = true;
			_rightCenterRightBottomLine.visible = true;
			_rightTopRightCenterLine.visible = true;
		}
		
		/**隐藏8条线*/
		public function hideAllLine():void{
			_leftTopTopCenterLine.visible = false;
			_topCenterRightTopLine.visible = false;
			_leftTopLeftCenterLine.visible = false;
			_leftCenterLeftBottomLine.visible = false;
			_leftBottomBottomCenterLine.visible = false;
			_bottomCenterRightBottomLine.visible = false;
			_rightCenterRightBottomLine.visible = false;
			_rightTopRightCenterLine.visible = false;
		}
		
		/**隐藏8个矩形*/
		public function hideAllRect():void{
			_leftTopRect.visible = false;
			_rightTopRect.visible = false;
			_leftBottomRect.visible = false;
			_rightBottomRect.visible = false;
			_topCenterRect.visible = false;
			_leftCenterRect.visible = false;
			_bottomCenterRect.visible = false;
			_rightCenterRect.visible = false;
		}
		
		/**刷新所有辅助组件拖动的矩形框*/
		public function refreshResizeUI():void{
			_leftTopRect.x = _centerRect.x-_leftTopRect.width;
			_leftTopRect.y = _centerRect.y -_leftTopRect.height;
			_rightTopRect.x = _centerRect.x + _centerRect.width;
			_rightTopRect.y = _centerRect.y - _leftBottomRect.height;
			_leftBottomRect.x = _centerRect.x-_leftBottomRect.width;
			_leftBottomRect.y = _centerRect.y + _centerRect.height;
			_rightBottomRect.x = _centerRect.x + _centerRect.width;
			_rightBottomRect.y = _centerRect.y + _centerRect.height;
			_topCenterRect.x = _centerRect.x + _centerRect.width/2 -_topCenterRect.width/2 ;
			_topCenterRect.y = _centerRect.y - _topCenterRect.height;
			_leftCenterRect.x = _centerRect.x - _leftCenterRect.width;
			_leftCenterRect.y = _centerRect.y + _centerRect.height/2 - _leftCenterRect.height/2;
			_bottomCenterRect.x =_centerRect.x + _centerRect.width/2 -_topCenterRect.width/2 ;
			_bottomCenterRect.y = _centerRect.y + _centerRect.height;
			_rightCenterRect.x = _centerRect.x + _centerRect.width;
			_rightCenterRect.y = _centerRect.y + _centerRect.height/2 - _leftCenterRect.height/2;
			showAllRect();
			updateLeftTopTopCenterLine();
			updateBottomCenterRightBottomLine();
			updateLeftBottomBottomCenterLine();
			updateLeftCenterLeftBottomLine();
			updateLeftTopLeftCenterLine();
			updateTopCenterRightTopLine();
			updateRightCenterRightBottomLine();
			updateRightTopRightCenterLine();
			_log.debug("refreshResizeUI............");
		}
		
		/**显示所有辅助组件拖动的矩形框*/
		public function showResizeUI():void{
			_leftTopRect.x = _uiComp.x-_leftTopRect.width;
			_leftTopRect.y = _uiComp.y -_leftTopRect.height;
			_rightTopRect.x = _uiComp.x + _uiComp.width;
			_rightTopRect.y = _uiComp.y - _leftBottomRect.height;
			_leftBottomRect.x = _uiComp.x-_leftBottomRect.width;
			_leftBottomRect.y = _uiComp.y + _uiComp.height;
			_rightBottomRect.x = _uiComp.x + _uiComp.width;
			_rightBottomRect.y = _uiComp.y + _uiComp.height;
			_topCenterRect.x = _uiComp.x + _uiComp.width/2 -_topCenterRect.width/2 ;
			_topCenterRect.y = _uiComp.y - _topCenterRect.height;
			_leftCenterRect.x = _uiComp.x - _leftCenterRect.width;
			_leftCenterRect.y = _uiComp.y + _uiComp.height/2 - _leftCenterRect.height/2;
			_bottomCenterRect.x =_uiComp.x + _uiComp.width/2 -_topCenterRect.width/2 ;
			_bottomCenterRect.y = _uiComp.y + _uiComp.height;
			_rightCenterRect.x = _uiComp.x + _uiComp.width;
			_rightCenterRect.y = _uiComp.y + _uiComp.height/2 - _leftCenterRect.height/2;
			showAllRect();
			updateLeftTopTopCenterLine();
			updateBottomCenterRightBottomLine();
			updateLeftBottomBottomCenterLine();
			updateLeftCenterLeftBottomLine();
			updateLeftTopLeftCenterLine();
			updateTopCenterRightTopLine();
			updateRightCenterRightBottomLine();
			updateRightTopRightCenterLine();
			showAllLine();
			_log.debug("showResizeUI............");
			
		}
		
		/**更新左上矩形和上中矩形之间的线条状态*/
		public function updateLeftTopTopCenterLine():void{
			_leftTopTopCenterLine.xFrom = _leftTopRect.x+_leftTopRect.width;
			_leftTopTopCenterLine.yFrom = _leftTopRect.y+_leftTopRect.height/2;
			_leftTopTopCenterLine.xTo = _topCenterRect.x;
			_leftTopTopCenterLine.yTo = _topCenterRect.y+_leftTopRect.height/2;
		}
		/**更新下中矩形和右下矩形之间的线条状态*/
		public function updateBottomCenterRightBottomLine():void{
			_bottomCenterRightBottomLine.xFrom = _bottomCenterRect.x + _bottomCenterRect.width;
			_bottomCenterRightBottomLine.yFrom = _bottomCenterRect.y + _bottomCenterRect.height/2;
			_bottomCenterRightBottomLine.xTo = _rightBottomRect.x;
			_bottomCenterRightBottomLine.yTo = _rightBottomRect.y + _rightBottomRect.height/2;
		}
		/**更新左下矩形和下中矩形之间的线条状态*/
		public function updateLeftBottomBottomCenterLine():void{
			_leftBottomBottomCenterLine.xFrom = _leftBottomRect.x + _leftBottomRect.width;
			_leftBottomBottomCenterLine.yFrom = _leftBottomRect.y + _leftBottomRect.height/2;
			_leftBottomBottomCenterLine.xTo = _bottomCenterRect.x;
			_leftBottomBottomCenterLine.yTo = _bottomCenterRect.y + _bottomCenterRect.height/2;
		}
		/**更新左中矩形和左下矩形之间的线条状态*/
		public function updateLeftCenterLeftBottomLine():void{
			_leftCenterLeftBottomLine.xFrom = _leftCenterRect.x + _leftCenterRect.width/2;
			_leftCenterLeftBottomLine.yFrom = _leftCenterRect.y + _leftCenterRect.height;
			_leftCenterLeftBottomLine.xTo = _leftBottomRect.x + _leftBottomRect.width/2;
			_leftCenterLeftBottomLine.yTo = _leftBottomRect.y;
		}
		/**更新左上矩形和左中矩形之间的线条状态*/
		public function updateLeftTopLeftCenterLine():void{
			_leftTopLeftCenterLine.xFrom = _leftTopRect.x + _leftTopRect.width/2;
			_leftTopLeftCenterLine.yFrom = _leftTopRect.y + _leftTopRect.height;
			_leftTopLeftCenterLine.xTo = _leftCenterRect.x + _leftCenterRect.width/2;
			_leftTopLeftCenterLine.yTo = _leftCenterRect.y;
		}
		/**更新上中矩形和右上矩形之间的线条状态*/
		public function updateTopCenterRightTopLine():void{
			_topCenterRightTopLine.xFrom = _topCenterRect.x+_topCenterRect.width;
			_topCenterRightTopLine.yFrom = _topCenterRect.y+_topCenterRect.height/2;
			_topCenterRightTopLine.xTo = _rightTopRect.x;
			_topCenterRightTopLine.yTo = _rightTopRect.y+_rightTopRect.height/2;
			
		}
		/**更新右中矩形和左中矩形之间的线条状态*/
		public function updateRightCenterRightBottomLine():void{
			_rightCenterRightBottomLine.xFrom = _rightCenterRect.x + _rightCenterRect.width/2;
			_rightCenterRightBottomLine.yFrom = _rightCenterRect.y + _rightCenterRect.height;
			_rightCenterRightBottomLine.xTo = _rightBottomRect.x + _rightBottomRect.width/2;
			_rightCenterRightBottomLine.yTo = _rightBottomRect.y;
		}
		
		/**更新右上矩形和右中矩形之间的线条状态*/
		public function updateRightTopRightCenterLine():void{
			_rightTopRightCenterLine.xFrom = _rightTopRect.x + _rightTopRect.width/2;
			_rightTopRightCenterLine.yFrom = _rightTopRect.y + _rightTopRect.height;
			_rightTopRightCenterLine.xTo = _rightCenterRect.x + _rightCenterRect.width/2;
			_rightTopRightCenterLine.yTo = _rightCenterRect.y;
		}
		
	}
}